local zhanbu = fk.CreateSkill{
    name = "lingling__zhanbu",
}
Fk:loadTranslationTable{
    ["lingling__zhanbu"] = "战卜",
    [":lingling__zhanbu"] = "每回合限一次，当你造成或受到伤害后，你可以卜算2，然后摸两张牌，你可以先弃置一张装备牌，改为卜算5。",
    ["#lingling__zhanbu-invoke"] = "是否发动 战卜，卜算2，再摸两张牌",
    ["#lingling__zhanbu-discard"] = "战卜：你可以弃置一张装备牌，多卜算三张牌",
}
local spec = {
    anim_type = "drawcard",
    can_trigger = function (self, event, target, player, data)
        return player == target and player:hasSkill(zhanbu.name) and player:usedSkillTimes(zhanbu.name,Player.HistoryTurn) == 0
    end,
    on_cost = function (self, event, target, player, data)
        if player.room:askToSkillInvoke(player,{
            skill_name = zhanbu.name,
            prompt = "#lingling__zhanbu-invoke"
        }) then
            return true
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local cards = room:askToDiscard(player,{
            max_num = 1,
            min_num = 1,
            cancelable = true,
            skill_name = zhanbu.name,
            include_equip = true,
            pattern = ".|.|.|.|.|equip",
            prompt = "#lingling__zhanbu-discard"
        })
        if #cards > 0 then
            room:askToGuanxing(player, { cards = room:getNCards(5), skill_name = zhanbu.name})
        else
            room:askToGuanxing(player, { cards = room:getNCards(2), skill_name = zhanbu.name})
        end
        player:drawCards(2,zhanbu.name)
    end,
}
zhanbu:addEffect(fk.Damage,spec)
zhanbu:addEffect(fk.Damaged,spec)
return zhanbu